package it.polimi.TravelDream;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the basepackexlinker database table.
 * 
 */
@Embeddable
public class BasepackexlinkerPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(insertable=false, updatable=false)
	private int packageID;

	@Column(insertable=false, updatable=false)
	private int excursionID;

	public BasepackexlinkerPK() {
	}
	public int getPackageID() {
		return this.packageID;
	}
	public void setPackageID(int packageID) {
		this.packageID = packageID;
	}
	public int getExcursionID() {
		return this.excursionID;
	}
	public void setExcursionID(int excursionID) {
		this.excursionID = excursionID;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof BasepackexlinkerPK)) {
			return false;
		}
		BasepackexlinkerPK castOther = (BasepackexlinkerPK)other;
		return 
			(this.packageID == castOther.packageID)
			&& (this.excursionID == castOther.excursionID);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.packageID;
		hash = hash * prime + this.excursionID;
		
		return hash;
	}
}